class SoundEffect {
  constructor() {
    this.collisionSound = new Audio('/collision.mp3');
    this.scoreSound = new Audio('/score.mp3');
    this.engineSound = new Audio('/engine.mp3');
    this.engineSound.loop = true;
  }

  createCollisionSound() {
    this.collisionSound.currentTime = 0;
    this.collisionSound.play();
  }

  createScoreSound() {
    this.scoreSound.currentTime = 0;
    this.scoreSound.play();
  }

  createEngineSound() {
    this.engineSound.play();
    return this.engineSound;
  }

  stopSound(sound) {
    if (sound) {
      sound.pause();
      sound.currentTime = 0;
    }
  }
}

export default new SoundEffect(); 